package com.core;

import com.bone.HttpRequest;
import com.bone.HttpRequestImpl;
import com.bone.HttpResponse;
import com.bone.HttpResponseImpl;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;
import java.nio.charset.StandardCharsets;

public class serverThread implements Runnable {
    private Socket socket;

    public Socket getSocket() {
        return socket;
    }

    public void setSocket(Socket socket) {
        this.socket = socket;
    }

    public serverThread(Socket socket) {
        this.setSocket(socket);
    }

    @Override
    public void run() {
        try {
            HttpRequest httpRequest = new HttpRequestImpl(socket);
            HttpResponse httpResponse = new HttpResponseImpl(socket);
            httpResponse.response();
            socket.close();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
